﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using KaiXin001er.Objects;

namespace KaiXin001er
{
    public partial class FormNewAccount : Form
    {
        public FormNewAccount()
        {
            InitializeComponent();
        }
        private bool checkInput()
        {
            if (txt_Name.Text == "") { MessageBox.Show("请输入姓名"); return false; }
            if (txt_Email.Text == "") { MessageBox.Show("请输入Email"); return false; }
            if (txt_pwd.Text == "") { MessageBox.Show("请输入密码"); return false; }
            if (txt_Email.Text.IndexOf('@') < 0) { MessageBox.Show("Email地址不合法"); return false; }
            userName = txt_Name.Text;
            email = txt_Email.Text;
            password = txt_pwd.Text;
            return true;
        }
        public string userName;
        public string email;
        public string password;
        private void button1_Click(object sender, EventArgs e)
        {
            if (checkInput())
            {
                this.DialogResult = DialogResult.OK;
                this.Dispose();
            }
        }
    }
}
